Namespace - LJCDataAccess
Parameters
procedureName - The procedure name.
parameters - The procedure parameters.
Returns
A reference to the
DataTable
object.
Syntax
C# |
public DataTable GetProcedureDataTable(String procedureName, ProcedureParameters parameters)
|
Executes a Stored Procedure and retrieves the
DataTable
object.
(E)
Example
C# |
private static void GetProcedureDataTable(DataAccess dataAccess)
{
var parameters = new ProcedureParameters()
{
{ "@ID", SqlDbType.Int, 0, 8 }
};
string procedureName = "dbo.sp_RetrieveByID";
var dataTable = dataAccess.GetProcedureDataTable(procedureName
, parameters);
if (dataTable != null)
{
foreach (DataRow dataRow in dataTable.Rows)
{
for int index = 0; index < dataTable.Columns.Count; index++)
{
string value = dataRow[index].ToString();
}
}
}
}
|
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.